@isTest
private class Opportunityattachment_Test {

    static testMethod void OpportunityAttachment() {
        RecordType rec1=[Select Id From RecordType where SobjectType='Account' and IsActive=true and  Name='AAS Master Client'] ;
RecordType rec2=[Select Id From RecordType where SobjectType='Account' and IsActive=true and  Name='AAS Sales Account'] ;
Account acc1 = new Account();

    acc1.RecordTypeId =rec1.Id;
    acc1.Name = 'MasteraccountTest';
    insert acc1;
Account acc2 = new Account();
    acc2.RecordTypeId =rec2.Id;
    acc2.Master_Client__c=acc1.Id;
    acc2.Name = 'accountTest';
    insert acc2;
    Opportunity opp = new Opportunity();
    opp.RecordTypeId = RecordTypeHelper.GetRecordTypeId('Opportunity', 'Advanced Ad Solutions');
    opp.AccountId = acc2.Id;
    opp.Name = 'AAS opp test';
    opp.StageName = 'Closed Won';
    opp.CloseDate = Date.today().addDays(1);
    opp.Credit_Check_Info_Secured__c='Yes';
    opp.Contract_Start_Date__c=date.today();
    opp.Contract_Termination_Date__c=date.today();
    opp.Amount=1000;
    opp.LeadSource='Cold Call';
    insert opp;
    Quote quot= new Quote();
    quot.OpportunityId=opp.Id;
    quot.status='RFP Draft';
    //quot.Account=acc2.ID;
    quot.Name='Quote test';
    insert quot;
    Order__c fulfillmentorder= new Order__c();
    fulfillmentorder.Opportunity__c=opp.Id;
    fulfillmentorder.Credit_Check_Info_Secured__c=opp.Credit_Check_Info_Secured__c;
    fulfillmentorder.Campaign_End_Date__c=Date.Today();
    fulfillmentorder.Renewal_Date__c=Date.Today();
    insert fulfillmentorder;
    Attachment attch= new Attachment(Name ='Testattch', ParentId = opp.Id, Body = Blob.valueOf('This is a Test'));
    insert attch;
    ApexPages.StandardController controller=new ApexPages.StandardController(opp);
    Oppattachmentcontroller oppattach=new Oppattachmentcontroller(controller);
    oppattach.getParam('0');
    oppattach.del();
    oppattach.edit();
    }
}